package com.etc.dao.user;

import com.etc.po.Login;
import com.etc.po.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface UserMapper {


    @Select("   select \n" +
            "   MEMBERID, LOGINNAME, PASSWORD, LOGINDATE, DELETEFLAG, MAKER, MAKEDATE, UPDATER, UPDATEDATE\n" +
            "    from m_login  where loginname = #{loginname}   ")
    public Login selectByLoginUname(Login login);

    @Update("  update  m_login set logindate = now() where MEMBERID = #{memberid} ")
    int updateLoginDate(Login loginpo);


    @Select("  SELECT t1.departmentid departmentid, t1.departmentname departmentname\n" +
            "FROM m_department t1\n" +
            "WHERE t1.DELETEFLAG = 0")
    List<HashMap> selectAllDept();

    List<Member> findByCondition(HashMap params);
}
